package com.perseygroup.apps.module.stages;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.perseygroup.apps.R;

public class DescriptionStageActivity extends ModuleStages {
	
	private TextView mUserName, titreTv;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.descriptionstage);
        
        //Set Username of the student
        String[] dataStudent = getStudentDataFromPrefs();
        if(dataStudent[0] != null)
        {
        	mUserName = (TextView) findViewById(R.id.username);
            mUserName.setText(dataStudent[0].toUpperCase());
        }
        
        Intent i = getIntent();
        String titre = i.getStringExtra("titre");
        String entreprise = i.getStringExtra("entreprise");
        String lieu = i.getStringExtra("lieu");
        String description = i.getStringExtra("description");
        String datepub = i.getStringExtra("datepub");
        
        titreTv = (TextView)findViewById(R.id.titre);
        titreTv.setText(titre);
        
        TextView entrepriseTv = (TextView)findViewById(R.id.entreprise);
        entrepriseTv.setText(entreprise);
        
        TextView lieuTv = (TextView)findViewById(R.id.lieu);
        lieuTv.setText(lieu + "\n");
        
        TextView descriptionTv = (TextView)findViewById(R.id.descrtipion);
        descriptionTv.setText(description);
        
        TextView datepubTv = (TextView)findViewById(R.id.datepub);
        datepubTv.setText(datepub);
        
	}
	
	public void onBackPressed()
	{
		finish();
	}
}
